PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Appearance Manager >

Programming With the Appearance Manager


MyThemeButtonDrawProc

Draws a button label.

Here's how to declare a button label drawing function, if you were to name the function MyThemeButtonDrawProc :

pascal void MyThemeButtonDrawProc (
                     const Rect *bounds,
                     ThemeButtonKind kind,
                     ThemeButtonDrawInfo *info,
                     UInt32 userData,
                     SInt16 depth,
                     Boolean isColorDev);
bounds
A pointer to a structure of type Rect . The rectangle you are passed is set to the area in which you should draw your content. Your button label drawing function is called clipped to the rectangle in which you are allowed to draw your content; do not draw outside this region. Note that if a right-to-left adornment is specified in the ThemeButtonDrawInfo structure passed into the info parameter, you may need to accommodate this orientation when placing your content.
kind
A value of type ThemeButtonKind . You are passed a constant specifying the button type. See Theme Button Kind Constants for descriptions of possible values.
info
A pointer to a structure of type ThemeButtonDrawInfo . The structure is set to contain the current state, value, and adornment for the button.
userData
An unsigned 32-bit value. You are passed data specifying how to draw the content, from the inUserData parameter of DrawThemeButton .
depth
A signed 16-bit value. You are passed the bit depth (in bits per pixel) of the current graphics port.
isColorDev
A value of type Boolean . If true , indicates that you are drawing on a color device; a value of false indicates a monochrome device.
DISCUSSION

At the time your button label drawing function is called, the foreground text color and mode is already set to draw in the correct state (active or inactive) and correct color for the theme. You do not need to set the color unless you have special drawing needs. If you do have special drawing needs, you should supply the depth value and the value of the isColorDevice parameter to the function IsThemeInColor to determine whether or not you should draw your content in color. Note that the Appearance Manager calls your MyThemeButtonDrawProc function for every device that the bounds rectangle intersects.

SPECIAL CONSIDERATIONS

The Appearance Manager draws the button background prior to calling your button label drawing function, so you should not erase the button background from your label drawing function.

VERSION NOTES

Available with Appearance Manager 1.1 and later.


© 1999 Apple Computer, Inc. – (Last Updated 29 April 99)